from spass.core.plugins import plugin

builtins_list = ['add', 'builtin', 'help', 'export', 'info', 'init', 'list', 'plugin', 'remove', 'search', 'test', 'version']

from spass.core.builtins.help import (help, version,)
from spass.core.builtins.add import (add,)
from spass.core.builtins.list import (list,)
from spass.core.builtins.init import (init,)
from spass.core.builtins.info import (info,)
from spass.core.builtins.remove import (remove,)
from spass.core.builtins.export import (export,)
from spass.core.builtins.search import (search,)
from spass.core.builtins.test import (test,)

def is_builtin(command_name):
    if builtins_list.count(command_name) > 0:
        return True
    return False
	
def run_builtin(command_name, options):
    return eval(command_name + "(options)")

def list_builtins():
    print 'Spass built-ins : '
    for b in builtins_list:
        print "\t- " + b

def builtin(argv):
    list_builtins()
    return 0
